package at.jku.se.pr.quickshopper.activities;

import at.jku.se.pr.quickshopper.R;
import at.jku.se.pr.quickshopper.R.id;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

/**
 * class which implements the view from where you can start a new ShoppingActivity
 * (generated when a payment activity has been completed) 
 * start a new purchase by clicking on the "neuen Einkauf starten"-Button 
 */
public class EndActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_end);
		
		Button restart = (Button) findViewById(id.btn_startAgain);
		restart.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent i = new Intent(EndActivity.this, ShoppingActivity.class);
				i.putExtra("from", 3);
				startActivity(i);
			}
			
		});
		
	}
	
	@Override
	public void onBackPressed() {
		Toast.makeText(this, "nicht erlaubt", Toast.LENGTH_SHORT).show();
		return;
	}

}
